/**
 * Copyright 2025 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */

:host([dir]),
:host {
    --spectrum-statuslight-height: var(--spectrum-component-height-100);
    --spectrum-statuslight-dot-size: var(--spectrum-status-light-dot-size-medium);
    --spectrum-statuslight-font-size: var(--spectrum-font-size-100);
    --spectrum-statuslight-spacing-dot-to-label: var(--spectrum-text-to-visual-100);
    --spectrum-statuslight-spacing-top-to-dot: var(--spectrum-status-light-top-to-dot-medium);
    --spectrum-statuslight-spacing-top-to-label: var(--spectrum-component-top-to-text-100);
    --spectrum-statuslight-spacing-bottom-to-label: var(--spectrum-component-bottom-to-text-100);
}

:host([size="s"]) {
    --spectrum-statuslight-height: var(--spectrum-component-height-75);
    --spectrum-statuslight-dot-size: var(--spectrum-status-light-dot-size-small);
    --spectrum-statuslight-font-size: var(--spectrum-font-size-75);
    --spectrum-statuslight-spacing-dot-to-label: var(--spectrum-text-to-visual-75);
    --spectrum-statuslight-spacing-top-to-dot: var(--spectrum-status-light-top-to-dot-small);
    --spectrum-statuslight-spacing-top-to-label: var(--spectrum-component-top-to-text-75);
    --spectrum-statuslight-spacing-bottom-to-label: var(--spectrum-component-bottom-to-text-75);
}

:host([size="l"]) {
    --spectrum-statuslight-height: var(--spectrum-component-height-200);
    --spectrum-statuslight-dot-size: var(--spectrum-status-light-dot-size-large);
    --spectrum-statuslight-font-size: var(--spectrum-font-size-200);
    --spectrum-statuslight-spacing-dot-to-label: var(--spectrum-text-to-visual-200);
    --spectrum-statuslight-spacing-top-to-dot: var(--spectrum-status-light-top-to-dot-large);
    --spectrum-statuslight-spacing-top-to-label: var(--spectrum-component-top-to-text-200);
    --spectrum-statuslight-spacing-bottom-to-label: var(--spectrum-component-bottom-to-text-200);
}

:host([size="xl"]) {
    --spectrum-statuslight-height: var(--spectrum-component-height-300);
    --spectrum-statuslight-dot-size: var(--spectrum-status-light-dot-size-extra-large);
    --spectrum-statuslight-font-size: var(--spectrum-font-size-300);
    --spectrum-statuslight-spacing-dot-to-label: var(--spectrum-text-to-visual-300);
    --spectrum-statuslight-spacing-top-to-dot: var(--spectrum-status-light-top-to-dot-extra-large);
    --spectrum-statuslight-spacing-top-to-label: var(--spectrum-component-top-to-text-300);
    --spectrum-statuslight-spacing-bottom-to-label: var(--spectrum-component-bottom-to-text-300);
}

:host([dir]) {
    --spectrum-statuslight-corner-radius: 50%;
    --spectrum-statuslight-font-weight: 400;
    --spectrum-statuslight-border-width: var(--spectrum-border-width-100);
    --spectrum-statuslight-line-height: var(--spectrum-line-height-100);
    --spectrum-statuslight-line-height-cjk: var(--spectrum-cjk-line-height-100);
    --spectrum-statuslight-content-color-default: var(--spectrum-neutral-content-color-default);
    --spectrum-statuslight-subdued-content-color-default: var(--spectrum-neutral-subdued-content-color-default);
    --spectrum-statuslight-semantic-neutral-color: var(--spectrum-neutral-visual-color);
    --spectrum-statuslight-semantic-accent-color: var(--spectrum-accent-visual-color);
    --spectrum-statuslight-semantic-negative-color: var(--spectrum-negative-visual-color);
    --spectrum-statuslight-semantic-info-color: var(--spectrum-informative-visual-color);
    --spectrum-statuslight-semantic-notice-color: var(--spectrum-notice-visual-color);
    --spectrum-statuslight-semantic-positive-color: var(--spectrum-positive-visual-color);
    --spectrum-statuslight-nonsemantic-gray-color: var(--spectrum-gray-visual-color);
    --spectrum-statuslight-nonsemantic-red-color: var(--spectrum-red-visual-color);
    --spectrum-statuslight-nonsemantic-orange-color: var(--spectrum-orange-visual-color);
    --spectrum-statuslight-nonsemantic-yellow-color: var(--spectrum-yellow-visual-color);
    --spectrum-statuslight-nonsemantic-chartreuse-color: var(--spectrum-chartreuse-visual-color);
    --spectrum-statuslight-nonsemantic-celery-color: var(--spectrum-celery-visual-color);
    --spectrum-statuslight-nonsemantic-green-color: var(--spectrum-green-visual-color);
    --spectrum-statuslight-nonsemantic-seafoam-color: var(--spectrum-seafoam-visual-color);
    --spectrum-statuslight-nonsemantic-cyan-color: var(--spectrum-cyan-visual-color);
    --spectrum-statuslight-nonsemantic-blue-color: var(--spectrum-blue-visual-color);
    --spectrum-statuslight-nonsemantic-indigo-color: var(--spectrum-indigo-visual-color);
    --spectrum-statuslight-nonsemantic-purple-color: var(--spectrum-purple-visual-color);
    --spectrum-statuslight-nonsemantic-fuchsia-color: var(--spectrum-fuchsia-visual-color);
    --spectrum-statuslight-nonsemantic-magenta-color: var(--spectrum-magenta-visual-color);

    min-block-size: var(--mod-statuslight-height, var(--spectrum-statuslight-height));
    box-sizing: border-box;
    font-size: var(--mod-statuslight-font-size, var(--spectrum-statuslight-font-size));
    font-weight: 400;
    font-weight: var(--mod-statuslight-font-weight, var(--spectrum-statuslight-font-weight));
    line-height: var(--mod-statuslight-line-height, var(--spectrum-statuslight-line-height));
    color: var(--highcontrast-statuslight-content-color-default, var(--mod-statuslight-content-color-default, var(--spectrum-statuslight-content-color-default)));
    flex-direction: row;
    align-items: flex-start;
    padding-block-start: var(--mod-statuslight-spacing-top-to-label, var(--spectrum-statuslight-spacing-top-to-label));
    padding-block-end: var(--mod-statuslight-spacing-bottom-to-label, var(--spectrum-statuslight-spacing-bottom-to-label));
    padding-inline: 0;
    display: flex;
}

:host(:lang(ja)),
:host(:lang(ko)),
:host(:lang(zh)) {
    line-height: var(--mod-statuslight-line-height-cjk, var(--spectrum-statuslight-line-height-cjk));
}

:host:before {
    --spectrum-statuslight-spacing-computed-top-to-dot: calc(var(--mod-statuslight-spacing-top-to-dot, var(--spectrum-statuslight-spacing-top-to-dot)) - var(--mod-statuslight-spacing-top-to-label, var(--spectrum-statuslight-spacing-top-to-label)));

    content: "";
    inline-size: var(--mod-statuslight-dot-size, var(--spectrum-statuslight-dot-size));
    block-size: var(--mod-statuslight-dot-size, var(--spectrum-statuslight-dot-size));
    border-radius: var(--mod-statuslight-corner-radius, var(--spectrum-statuslight-corner-radius));
    flex-grow: 0;
    flex-shrink: 0;
    margin-block-start: var(--spectrum-statuslight-spacing-computed-top-to-dot);
    margin-inline-end: var(--mod-statuslight-spacing-dot-to-label, var(--spectrum-statuslight-spacing-dot-to-label));
    display: inline-block;
}

:host([variant="neutral"]) {
    color: var(--highcontrast-statuslight-subdued-content-color-default, var(--mod-statuslight-subdued-content-color-default, var(--spectrum-statuslight-subdued-content-color-default)));
    font-style: italic;
}

:host([variant="neutral"]):before {
    background-color: var(--mod-statuslight-semantic-neutral-color, var(--spectrum-statuslight-semantic-neutral-color));
}

:host([variant="accent"]):before {
    background-color: var(--mod-statuslight-semantic-accent-color, var(--spectrum-statuslight-semantic-accent-color));
}

:host([variant="info"]):before {
    background-color: var(--mod-statuslight-semantic-info-color, var(--spectrum-statuslight-semantic-info-color));
}

:host([variant="negative"]):before {
    background-color: var(--mod-statuslight-semantic-negative-color, var(--spectrum-statuslight-semantic-negative-color));
}

:host([variant="notice"]):before {
    background-color: var(--mod-statuslight-semantic-notice-color, var(--spectrum-statuslight-semantic-notice-color));
}

:host([variant="positive"]):before {
    background-color: var(--mod-statuslight-semantic-positive-color, var(--spectrum-statuslight-semantic-positive-color));
}

.spectrum-StatusLight--gray:before {
    background-color: var(--mod-statuslight-nonsemantic-gray-color, var(--spectrum-statuslight-nonsemantic-gray-color));
}

.spectrum-StatusLight--red:before {
    background-color: var(--mod-statuslight-nonsemantic-red-color, var(--spectrum-statuslight-nonsemantic-red-color));
}

.spectrum-StatusLight--orange:before {
    background-color: var(--mod-statuslight-nonsemantic-orange-color, var(--spectrum-statuslight-nonsemantic-orange-color));
}

:host([variant="yellow"]):before {
    background-color: var(--mod-statuslight-nonsemantic-yellow-color, var(--spectrum-statuslight-nonsemantic-yellow-color));
}

:host([variant="chartreuse"]):before {
    background-color: var(--mod-statuslight-nonsemantic-chartreuse-color, var(--spectrum-statuslight-nonsemantic-chartreuse-color));
}

:host([variant="celery"]):before {
    background-color: var(--mod-statuslight-nonsemantic-celery-color, var(--spectrum-statuslight-nonsemantic-celery-color));
}

.spectrum-StatusLight--green:before {
    background-color: var(--mod-statuslight-nonsemantic-green-color, var(--spectrum-statuslight-nonsemantic-green-color));
}

:host([variant="seafoam"]):before {
    background-color: var(--mod-statuslight-nonsemantic-seafoam-color, var(--spectrum-statuslight-nonsemantic-seafoam-color));
}

:host([variant="cyan"]):before {
    background-color: var(--mod-statuslight-nonsemantic-cyan-color, var(--spectrum-statuslight-nonsemantic-cyan-color));
}

.spectrum-StatusLight--blue:before {
    background-color: var(--mod-statuslight-nonsemantic-blue-color, var(--spectrum-statuslight-nonsemantic-blue-color));
}

:host([variant="indigo"]):before {
    background-color: var(--mod-statuslight-nonsemantic-indigo-color, var(--spectrum-statuslight-nonsemantic-indigo-color));
}

:host([variant="purple"]):before {
    background-color: var(--mod-statuslight-nonsemantic-purple-color, var(--spectrum-statuslight-nonsemantic-purple-color));
}

:host([variant="fuchsia"]):before {
    background-color: var(--mod-statuslight-nonsemantic-fuchsia-color, var(--spectrum-statuslight-nonsemantic-fuchsia-color));
}

:host([variant="magenta"]):before {
    background-color: var(--mod-statuslight-nonsemantic-magenta-color, var(--spectrum-statuslight-nonsemantic-magenta-color));
}

@media (forced-colors: active) {
    :host([dir]) {
        --highcontrast-statuslight-content-color-default: CanvasText;
        --highcontrast-statuslight-subdued-content-color-default: CanvasText;

        forced-color-adjust: none;
    }

    :host:before {
        forced-color-adjust: none;
        border: var(--mod-statuslight-border-width, var(--spectrum-statuslight-border-width)) solid ButtonText;
    }
}
